import { getDachshundRequest } from "@common/utils";
import { CTX_PATH } from "@common/constants";
import Instance from "@common/remoteCallInterceptor";
import { TenantUrls } from "../urls";

export default {
  loadByAcct: () => {
    let req = getDachshundRequest();
    return Instance.dachshundInstance.post(TenantUrls.loadByAcct, req, {
      baseURL: CTX_PATH.getDachshundPrefix(),
    });
  },
  switchTenant: ({ tenantId }) => {
    let req = getDachshundRequest(
      {
        id: tenantId,
      },
      [tenantId]
    );
    return Instance.dachshundInstance.post(TenantUrls.switchTenant, req, {
      baseURL: CTX_PATH.getDachshundPrefix(),
    });
  },
};
